import request from '@/utils/request'

export default {
    //显示所有教师
    selectAll(page, limit) {
        return request({
            url: `/Teacher/selectAll`,
            method: 'get',
            params:{
                page: page,
                limit: limit
        } 
        })
    },
    //显示回收站教师
    selectDeleted(page, limit) {
        return request({
            url: `/Teacher/selectDeleted`,
            method: 'get',
            params:{
                page:` ${page}`,
                limit: `${limit}`
        } 
        })
    },
    //根据条件搜索教师
    selectBykeyWord(page, limit,selectByAny) {
        return request({
            url: `/Teacher/selectBykeyWord?page=${page}&limit=${limit}`,
            method: 'post',
            data: selectByAny
        })
    },
    //搜索一个教师详细信息
    selectOne(id) {
        return request({
            url: `/Teacher/selectOne?id=${id}`,
            method: 'get'
        })
    },
    //搜索回收站教师
    selectOneInDeleted(page, limit,selectByAny) {
        return request({
            url: `/Teacher/selectOneInDeleted?page=${page}&limit=${limit}`,
            method: 'post',
            data: selectByAny
        })
    },
    //更新教师
    updayteOne(teacher) {
        return request({
            url: `/Teacher/updayteOne`,
            method: 'post',
            data: teacher
        })
    },
    //删除教师
    deleteById(ids) {
        return request({
            url: `/Teacher/deleteById`,
            method: 'post',
            data: ids
        })
    },
    //彻底删除教师
    deleteTotallyById(ids) {
        return request({
            url: `/Teacher/deleteTotallyById`,
            method: 'post',
            data: ids
        })
    },
    //恢复教师
    recoverOne(id) {
        return request({
            url: `/Teacher/recoverOne?id=${id}`,
            method: 'get'
        })
    },
    //新增教师
    insertOne(teacher) {
        return request({
            url: `/Teacher/insertOne`,
            method: 'post',
            data: teacher
        })
    }
}